<head>
    <title>GenomeScope</title>
    <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">
            
        <title>GenomeScope</title>
        <!--Dropzone-->
        <link href="css/dropzone.css" rel="stylesheet">
        <!-- Bootstrap core CSS -->
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <!-- Bootstrap theme -->
        <link href="css/bootstrap-theme.min.css" rel="stylesheet">
        <!-- Custom styles for this template -->
        <link href="css/theme.css" rel="stylesheet">
        <!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
           <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css"> -->
           
         
    <!--    custom styles-->
		<link href="css/custom_styles.css" rel="stylesheet">
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-73314063-1', 'auto');
      ga('send', 'pageview');

    </script>

    
    <!-- <link rel="shortcut icon" type="image/png" href="images/cat_icon2_black.png"/> -->
    <!-- <link rel="icon" type="image/png" href="images/cat_icon2_black.png"/> -->
    
    
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body role="document">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
    <!-- <img class="kitty_icon" src="images/cat_icon2_white.png"/> -->
      <div class="container">
        
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href=".">        GenomeScope</a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
            <li><a href="./">Home</a></li>
            <!--<li><a href="./help.php">Help</a></li>-->
            <li><a href="./info.php">Info</a></li>
            <li class="dropdown">
              <a href="" class="dropdown-toggle" data-toggle="dropdown">Examples <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="analysis.php?code=example1">Seabass</a></li>
                <li><a href="analysis.php?code=example2">Oyster</a></li>
                <li><a href="analysis.php?code=example3">Pear</a></li>
                <li><a href="analysis.php?code=example4">Bird</a></li>
                <li><a href="analysis.php?code=example5">Drosophila</a></li>
                <li><a href="analysis.php?code=example6">Arabidopsis F1</a></li>
                <li><a href="analysis.php?code=example7">Coastal Redwood</a></li>
		<li><a href="analysis.php?code=example8">Cotton</a></li>
		<li><a href="analysis.php?code=example9">Root-knot Nematode</a></li>
		<li><a href="analysis.php?code=example10">Potato</a></li>
		<li><a href="analysis.php?code=example11">Wheat</a></li>
                <!--<li class="divider"></li>-->
                <!--<li class="dropdown-header">Nav header</li>-->
                <!--<li><a href="#">Separated link</a></li>-->
                <!--<li><a href="#">One more separated link</a></li>-->
              </ul>
            </li>

                  <?php
                      $my_datasets = array();

                      if(isset($_COOKIE["results"])) {
                        echo '<li class="dropdown">
                        <a href="" class="dropdown-toggle" data-toggle="dropdown">My results <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">';

                        $my_datasets = json_decode($_COOKIE["results"], true);

                        $arrlength = count($my_datasets);
                        $start_at = 0;
                        if ($arrlength > 20) {
                          $start_at = $arrlength - 20;
                        }
                        for($x = $start_at; $x < $arrlength; $x++) {
                          $seconds_ago = time() - $my_datasets[$x]["date"];
                          
                          $time_ago = $seconds_ago;
                          if ($seconds_ago > 60) {
                            $minutes_ago = $seconds_ago/60;
                            if ($minutes_ago > 60) {
                              $hours_ago = $minutes_ago/60;
                              if ($hours_ago > 24) {
                                $days_ago = $hours_ago/24;
                                $time_ago = "" . floor($days_ago) . " days";
                              } else {
                                $time_ago = "" . floor($hours_ago) . " hours";
                              }
                            } else {
                              $time_ago = "" . floor($minutes_ago) . " minutes";
                            }
                          } else {
                            $time_ago = "" . floor($seconds_ago) . " seconds";
                          }
                          
                          echo "<li><a href='analysis.php?code=" . $my_datasets[$x]["codename"] . "'>" . $my_datasets[$x]["description"] . " (" . $time_ago . " ago) </a></li>";
                        }

                        echo '</ul>';
                      } 
                  ?>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>





    
